const express =require('express')
const router=express.Router()
const artcate_handler=require('../router_handler/artcate')
const expressJoi=require('@escook/express-joi')
const {article_schema,deletecate_id_schema,get_cate_schema,update_cate_schema}=require('../schema/artcate')

//获取文章分类列表 
router.get('/cates',artcate_handler.getArticleCates)
// 新增文章分类
router.post('/addcates',expressJoi(article_schema),artcate_handler.addArticleCates)
// 根据id删除文章的分类
router.get('/deletecate/:id',expressJoi(deletecate_id_schema),artcate_handler.deleteCateById)
// 根据id获取文章分类的数据
router.get('/cates/:id',expressJoi(get_cate_schema),artcate_handler.getArtCateById)
// 根据id更新文章分类数据
router.post('/updatecate',expressJoi(update_cate_schema),artcate_handler.updateCateById )


module.exports=router